<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <!-- 1. 导入CSS的全局样式 -->
    <link href="${pageContext.request.contextPath}/web/css/bootstrap.min.css" rel="stylesheet">
    <!-- 2. jQuery导入，建议使用1.9以上的版本 -->
    <script src="${pageContext.request.contextPath}/web/js/jquery-2.1.0.min.js"></script>
    <!-- 3. 导入bootstrap的js文件 -->
    <script src="${pageContext.request.contextPath}/web/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        function deleteBook(id){
            //安全提示
            if (confirm("您确定要删除吗?")){
                location.href="${pageContext.request.contextPath}/book/deleteBook?id="+id;
            }
        }
        function downExcel(list){
        }
    </script>
</head>
<body>
<h4 style="display: inline-block" >书籍</h4> <a href="${pageContext.request.contextPath}/book/easyExcelServlet?list=${pb.list}" style="margin-left: 20px; border: 1px solid black">导出Excel</a>
<div>
    <div style="margin-left: 20px ">
    <table border="solid 2px">
        <thead >
        <tr>
            <td>编号</td>
            <td>名称</td>
            <td>数量</td>
            <td>详情</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
        <tr>
            <c:forEach var="books" items="${pb.list}">
            <td>${books.bookID}</td>
            <td>${books.bookName}</td>
            <td>${books.bookCounts}</td>
            <td>${books.detail}</td>
            <td><a href="javascript:deleteBook(${books.bookID});">删除</a>||<a href="${pageContext.request.contextPath}/book/toUpdateBooks?id=${books.bookID}">修改</a></td>
        </tr>
            </c:forEach>
        </tbody>
    </table>
        <div style="margin-left: -10px">
            <a href="${pageContext.request.contextPath}/book/findBookByPage?currentPage=${pb.currentPage-1}&rows=5&keyword=${keyword}">上一页</a>&nbsp;&nbsp;
           <c:forEach begin="${pb.startPage}" var="i" end="${pb.endPage}">
              <a href="${pageContext.request.contextPath}/book/findBookByPage?currentPage=${i}&rows=5&keyword=${keyword}">${i}</a>
           </c:forEach>
            <a href="${pageContext.request.contextPath}/book/findBookByPage?currentPage=${pb.currentPage+1}&rows=5&keyword=${keyword}">下一页</a>
            <span>
                   当前${pb.currentPage}页,共${pb.totalPage}页,共${pb.totalCount}条记录
            </span>
        </div>
        <div style="margin-top: 10px">
            <a href="#" style="color: black">搜索书籍:</a>
        </div>
        <div style="position: relative;top: -20px ;left: 78px" >
<%--  提交地点--%>
            <form action="${pageContext.request.contextPath}/book/findBookByPage">
<%--   增加一行记录--%>
                <input style="height: 22px;width:100px;margin-left: -3px" value="${keyword}" type="text"  name="keyword">
                <input type="submit" value="确定"  style="font-size:5px">
            </form>
        </div>
    </div>
</div>
</body>
</html>
